<?php

class lfController
{

	function __construct()
	{
		$this->MappingRequest();
		$this->application = lfApplication::GetInstance();
		
		$moduleName = $this->application->MODULE_NAME();
		$methodName = $this->application->METHOD_NAME();
		
		
		$this->view = new lfView();
		$this->view->SetLayout($moduleName);
		$this->view->SetTemplate($methodName);
		if ($this->bkSubmit)
		{
			require_once PATH_ROOT . '/library/plugin/lfJquery.php';
			$this->view->SetJquery(new lfJquery());
		}
	}

	function __destruct()
	{
		$this->view->Display();
	}

	/**
	 * 是否POST表单
	 *
	 * @return boolean
	 */
	protected function IS_POST()
	{
		return sizeof($_POST) ? TRUE : FALSE;
	}

	protected function IS_GET()
	{
		return (sizeof($_GET)) ? TRUE : FALSE;
	}

	// 引用其它的应用程序模块
	protected function AppRefrence($appName)
	{
		
	}
	
	protected function RegSmartDao()
	{
		require_once PATH_ROOT.'/applications/'.$this->application->APP_NAME().'/libs/SmartDao.php';
	}
	
	private function MappingRequest()
	{
		
		foreach ( $_REQUEST as $key => $value )
		{
			$this->$key = $value;
		}
	
	}
	
	/**
	 * 应用程序对象 
	 *
	 * @var lfApplication
	 */
	protected $application = NULL;
	
	/**
	 * 视图对象
	 *
	 * @var lfView
	 */
	protected $view;
	
	

}

?>